<template>
	<view class="myfensi">
		<view class="head-card">
			<view class="info-1">
				<text>直属粉丝</text>
			</view>
			<view class="info-2">
				<text>{{ info.count || 0 }}</text>
			</view>
			<u-divider lineColor="#fff" style="margin: 0"></u-divider>
			<view class="info-3">
				<view class="info-1">
					<text>粉丝总和</text>
					<text>{{ info.direct_num || 0 }}</text>
				</view>
				<view class="divider-y"></view>
				<view class="info-1">
					<text>累积奖励</text>
					<text>{{ info.yongjins || '0.00' }}</text>
				</view>
			</view>
		</view>

		<view class="container">
			<view class="title">我的下级</view>
			<view class="listbox">
				<!-- <j-yongJinList :list="list"></j-yongJinList> -->
				<j-xiaJinList :list="list"></j-xiaJinList>
				<u-loadmore :status="status" />
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'myfensi',
	data() {
		return {
			status: '',
			info: {},
			list: [],
			paging: {
				page: 1,
				pagenum: 10
			}
		};
	},
	onLoad() {
		this.reset();
		this.get_info();
		this.init();
	},
	onReachBottom() {
		if (this.status === 'nomore') return;
		this.init();
	},
	methods: {
		get_info() {
			this.$http.getJson('users_fansRecord', { type: 1 }).then((res) => {
				this.info = res;
			});
		},
		reset() {
			this.paging.page = 1;
			this.list = [];
		},
		init() {
			this.status = 'nomore';
			this.$http.getJson('users_fansRecord', { type: 1, ...this.paging }).then((res) => {
				const { code, data, message } = res;
				if (code === 1) {
					if (data.length !== 0) this.list = this.list.concat(data);
					if (data && this.paging.pagenum === data.length) {
						this.paging.page += 1;
						this.status = 'loadmore';
					} else {
						this.status = 'nomore';
					}
				}
			});
		}
	}
};
</script>

<style lang="less" scoped>
.myfensi {
	.txpopbox {
		width: 638rpx;
		padding: 40rpx 50rpx;
		background: #ffffff;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		.content {
			.tbox {
				.flex-center-y();
				padding: 10rpx 0 58rpx;
				text:nth-of-type(1) {
					font-size: 34rpx;
					font-family: PingFang SC-Regular, PingFang SC;
					font-weight: 400;
					color: #222222;
				}
				text:nth-of-type(2) {
					margin-top: 10rpx;
					font-size: 72rpx;
					font-family: PingFang SC-Heavy, PingFang SC;
					font-weight: 800;
					color: #222222;
					&:before {
						content: '￥';
						font-size: 52rpx;
					}
				}
				border-bottom: 2rpx solid #eeeeee;
			}
			.bbox {
				padding: 42rpx 0 62rpx;
				.row + .row {
					margin-top: 24rpx;
				}
				.row {
					.flex-between();
					text {
						font-size: 24rpx;
						font-family: PingFang SC-Regular, PingFang SC;
						font-weight: 400;
						color: #adadad;
					}
				}
			}
		}
		& > button {
			width: 538rpx;
			height: 64rpx;
			background: #07c160;
			border-radius: 8rpx 8rpx 8rpx 8rpx;
			font-size: 32rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #ffffff;
		}

		.title {
			text-align: center;
			font-size: 34rpx;
			font-family: PingFang SC-Heavy, PingFang SC;
			font-weight: 800;
			color: #222222;
			padding-bottom: 50rpx;
		}
		.tip {
			display: flex;
			align-items: center;
			padding: 0 20rpx;
			width: 538rpx;
			height: 80rpx;
			background: #f5f5f5;
			border-radius: 8rpx 8rpx 8rpx 8rpx;
			text:nth-of-type(1) {
				margin-right: 18rpx;
				font-size: 28rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #999999;
			}
			text:nth-of-type(2) {
				font-size: 28rpx;
				font-family: PingFang SC-Heavy, PingFang SC;
				font-weight: 800;
				color: #222222;
			}
		}

		.inputbox {
			padding: 50rpx 0;
			.row {
				text {
					font-size: 32rpx;
					font-family: PingFang SC-Regular, PingFang SC;
					font-weight: 400;
					color: #222222;
					word-spacing: 1em;
				}
			}

			.inpbox {
				height: 184rpx;
				display: flex;
				align-items: center;
				label {
					font-size: 54rpx;
					font-family: PingFang SC-Heavy, PingFang SC;
					font-weight: 800;
					color: #222222;
				}
				input {
					height: 100rpx;
					font-size: 72rpx;
					font-family: PingFang SC-Heavy, PingFang SC;
					font-weight: 800;
					color: #222222;
				}
			}
			.btip {
				text:nth-of-type(1) {
					font-size: 24rpx;
					font-family: PingFang SC-Regular, PingFang SC;
					font-weight: 400;
					color: #999999;
				}
				text:nth-of-type(2) {
					font-size: 24rpx;
					font-family: PingFang SC-Regular, PingFang SC;
					font-weight: 400;
					color: #f10018;
					.j-active();
				}
			}
		}
	}
	.divider-y {
		width: 1rpx;
		height: 100%;
		margin: 0 24rpx;
		background-color: #f2f2f2;
	}
	.u-tabs-box {
		height: 88rpx;
		background: #ffffff;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
	}
	.container {
		padding: 24rpx 32rpx;
		.title {
			font-size: 28rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: bold;
			color: #000000;
		}
	}
	.listbox {
		padding-top: 24rpx;
	}
	.head-card {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		width: 750rpx;
		height: 248rpx;
		padding: 26rpx 32rpx;
		// background: linear-gradient(135deg, #ffdccb 0%, #e2b89d 100%);

		background: linear-gradient(135deg, #ffe9cc 0%, #f2cea1 100%);
		.info-1 {
			.flex-between();
			font-size: 24rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: bold;
			color: #53361e;
			text:nth-of-type(1) {
				font-weight: bold;
			}
		}
		.info-2 {
			text:nth-of-type(1) {
				font-size: 56rpx;
				font-family: PingFang SC-Bold, PingFang SC;
				font-weight: bold;
				color: #53361e;
			}
		}
		.info-3 {
			display: flex;
			.info-1 {
				flex: 1;
			}
		}
	}
}
</style>
